package cn.gson.work.model.mapper;

import cn.gson.work.model.pojos.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ResourceMapper {

    //新增资源
    public void addResource(Resource resource);

    //修改资源
    public void updateResource(Resource resource);

    //查询资源
    public List<Resource> selectResource(@Param("resName") String resName, @Param("typeName") String typeName, @Param("typeId") Integer typeId);

    //新增资源分类
    public void addType(Resourcetype resourceType);

    //修改资源分类
    public void updateType(Resourcetype resourceType);

    //删除资源分类
    public void deleteType(long typeId);

    //查询资源分类
    public List<Resourcetype> selectType(String typeName);

    //新增资源申请
    public void addApplication(Application application);

    //修改资源申请
    public void updateApplication(Application application);

    //新增车辆申请
    public void addAppCar(Application application);

    //查询资源申请
    public List<Application> selectApp(@Param("appType") String appType, @Param("typeName") String typeName, @Param("appStage") String appStage);

    //查询车辆申请
    public List<Application> selectAppCar(@Param("appType") String appType,@Param("appStage") String appStage,@Param("carName") String carName);

    //新增车辆
    public void addCar(Car car);

    //修改车辆
    public void updateCar(Car car);

    //删除车辆
    public void deleteCar(Integer carId);

    //查询车辆
    public List<Car> selectCar();

    //查询用户
    public List<User> selectUser();

    //查询部门
    public List<Dept> selectDept();

    //归还资源
    public void updateAppBack(Application application);

    public void updateAppCar(@Param("carStage") String carStage, @Param("carId") long carId);

    public void updateApprover(Application application);
}
